var t = getApp(), e = (require("../../utils/util.js"), !1);

wx.createInnerAudioContext();

Page({
    data: {
        finger: []
    },
    onShow: function() {
        this.setData({
            sharing: !1
        }), e = !0, "function" == typeof this.getTabBar && this.getTabBar() && this.getTabBar().setData({
            selected: 5
        });
    },
    onShareAppMessage: function(t) {
        return {
            title: "指尖运气/指尖罗盘"
        };
    },
    onHide: function() {
        null != t && clearInterval(t);
    },
    onUnload: function() {
        null != t && clearInterval(t);
    },
    touchstart: function(e) {
        var a = this;
        null != t && clearInterval(t);
        var n = [];
        if (e.touches.forEach(function(t) {
            n.push({
                left: t.clientX,
                top: t.clientY,
                color: "blue"
            });
        }), this.setData({
            finger: n
        }), n.length > 1) {
            var r = 0, i = this.data.finger.length - 1;
            t = setInterval(function() {
                wx.vibrateShort();
                var e = Math.floor(Math.random() * (i - 0 + 1)) + 0;
                n.forEach(function(t, a) {
                    t.color = a == e ? "red" : "blue";
                }), a.setData({
                    finger: n
                }), (r += 200) >= 2e3 && clearInterval(t);
            }, 200);
        } else wx.vibrateShort();
    }
});